#!/usr/bin/env python

from dynamic_reconfigure.parameter_generator_catkin import ParameterGenerator, double_t, int_t, bool_t

gen = ParameterGenerator()

gen.add("automatic_mode", int_t, 0, "0 - Manual, 1 - Semiautomatic, 2 - Automatic", 0, 0, 2)
gen.add("undock_distance", double_t, 0, "Distance to drive back for undocking", 2, 0, 5)
gen.add("docking_distance", double_t, 0, "Distance to drive forward during docking", 2, 0, 5)
gen.add("docking_approach_distance", double_t, 0, "Distance to approach docking point", 1.5, 0, 5)
gen.add("docking_retry_count", int_t, 0, "How often should we retry docking", 4, 1, 10)
gen.add("outline_count", int_t, 0, "Outline count to mow before filling", 3, 0, 10)
gen.add("outline_offset", double_t, 0, "Additional outer outline offset, use positive values for safety, negative values to enlarge the area", 0.0, -1.0, 1.0)
gen.add("mow_angle_offset", double_t, 0, "Mowing angle offset", 0, -180, 180)
gen.add("mow_angle_offset_is_absolute", bool_t, 0, "If true then the offset is relative to East, if false then the offset is relative to the auto-detected angle.", False)
gen.add("mow_angle_increment", double_t, 0, "Mowing angle automatic increment. Will be added to the offset every time the entire map is finished", 0, 0, 180)
gen.add("tool_width", double_t, 0, "Width of the mower", 0.14, 0.1, 2)
gen.add("enable_mower", bool_t, 0, "True to enable mow motor", False)
gen.add("manual_pause_mowing", bool_t, 0, "True to disable mowing automatically", False)
gen.add("current_area", int_t, 0, "Current Mow Area", 0, 0, 99)
gen.add("battery_empty_voltage", double_t, 0, "Voltage to return to docking station", 25.0, 20.0, 32.0)
gen.add("battery_full_voltage", double_t, 0, "Voltage to start mowing again", 29.0, 20.0, 32.0)
gen.add("motor_hot_temperature", double_t, 0, "Motor temperature to pause mowing", 70.0, 20.0, 150.0)
gen.add("motor_cold_temperature", double_t, 0, "Motor temperature to allow mowing", 40.0, 20.0, 150.0)
gen.add("max_position_accuracy", double_t, 0, "We allow driving as long as our position is better than this value (m)", 0.2, 0.01, 1.0)
gen.add("gps_wait_time", double_t, 0, "Time to wait after good GPS fix", 10.0, 0.0, 60.0)
gen.add("gps_timeout", double_t, 0, "Time to allow driving without valid GPS", 10.0, 0.0, 60.0)
gen.add("add_fake_obstacle", bool_t, 0, "True to add a fake obstacle to hopefully help path approach", False)
gen.add("ignore_gps_errors", bool_t, 0, "True to ignore gps errors. USE ONLY FOR SIMULATION!", False)
gen.add("max_first_point_attempts", int_t, 0, "Maximum attempts to reach the first point of the mow path before trimming", 3, 1, 10)
gen.add("max_first_point_trim_attempts", int_t, 0, "After <max_first_point_attempts> we start to trim the path beginning this often", 3, 1, 10)

exit(gen.generate("mower_logic", "mower_logic", "MowerLogic"))
